Skip to content

fix(react): Add support for React Router sub-routes from handle #17277

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from

Conversation

onurtemizkan
Copy link
Collaborator

@onurtemizkan onurtemizkan commented Jul 31, 2025

Adds support for lazy loading sub-routes / components using the pattern below:

const routes [
  // ...
  {
    path: 'part1',
      handle: {
        lazyChildren: () =>
          import('./pages/SomeMoreNestedRoutes').then(
        (mod) => mod.someMoreNestedRoutes
      ),
    },
  },
]

lazyChildren is not a predefined key; it can be anything returning renderable data.

Not sure about the widespread usage of the pattern, but as it requires a recursive search inside the whole route tree, it potentially creates performance overhead.
So, added a new option [enableAsyncRouteHandlers] to the RR Tracing Integration and these checks will only run when it's set.

@onurtemizkan onurtemizkan requested a review from chargome July 31, 2025 20:39
cursor[bot]

This comment was marked as outdated.

@onurtemizkan onurtemizkan marked this pull request as draft August 1, 2025 05:23
@onurtemizkan onurtemizkan force-pushed the onur/react-router-support-async-handle branch from 728fb60 to 244a953 Compare August 4, 2025 08:46
@onurtemizkan onurtemizkan marked this pull request as ready for review August 4, 2025 09:29
cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

@onurtemizkan onurtemizkan force-pushed the onur/react-router-support-async-handle branch from fea5834 to 06e535e Compare August 5, 2025 05:43
cursor[bot]

This comment was marked as outdated.

@onurtemizkan onurtemizkan force-pushed the onur/react-router-support-async-handle branch from 81c1bc5 to e968adf Compare August 5, 2025 06:00
Copy link
Contributor

github-actions bot commented Aug 6, 2025

size-limit report 📦

Path Size % Change Change
@sentry/browser 24.04 kB - -
@sentry/browser - with treeshaking flags 22.62 kB - -
@sentry/browser (incl. Tracing) 39.75 kB - -
@sentry/browser (incl. Tracing, Replay) 77.86 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 67.69 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 82.56 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 94.66 kB - -
@sentry/browser (incl. Feedback) 40.7 kB - -
@sentry/browser (incl. sendFeedback) 28.7 kB - -
@sentry/browser (incl. FeedbackAsync) 33.59 kB - -
@sentry/react 25.76 kB - -
@sentry/react (incl. Tracing) 41.72 kB +0.06% +25 B 🔺
@sentry/vue 28.5 kB - -
@sentry/vue (incl. Tracing) 41.56 kB - -
@sentry/svelte 24.07 kB - -
CDN Bundle 25.55 kB - -
CDN Bundle (incl. Tracing) 39.64 kB - -
CDN Bundle (incl. Tracing, Replay) 75.7 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 81.11 kB - -
CDN Bundle - uncompressed 74.7 kB - -
CDN Bundle (incl. Tracing) - uncompressed 117.32 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 231.59 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 244.19 kB - -
@sentry/nextjs (client) 43.75 kB - -
@sentry/sveltekit (client) 40.2 kB - -
@sentry/node-core 47.73 kB - -
@sentry/node 146.62 kB - -
@sentry/node - without tracing 91.83 kB - -
@sentry/aws-serverless 103.27 kB - -

View base workflow run

@chargome chargome self-assigned this Aug 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants